<?xml version="1.0" encoding="utf-8"?>

<EFFECT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns ="urn:dsfx0">  

  <DST_STATE_GROUP>
    <NAME>DepthNoTestNoWrite</NAME>
    <DEPTH_ENABLE>false</DEPTH_ENABLE>
    <DEPTH_WRITE>false</DEPTH_WRITE>
  </DST_STATE_GROUP>

  <BLEND_STATE_GROUP>
    <NAME>NoBlend</NAME>
    <SEPARATE_BLEND>false</SEPARATE_BLEND>
    <TARGET>
      <ID>0</ID>
      <BLEND_ENABLE>false</BLEND_ENABLE>
    </TARGET>
  </BLEND_STATE_GROUP>

  <!-- Tone Mapping -->
  
  <CONSTANT_BUFFER>
    <NAME>cbPostEffect_ToneMapping_FilmicALU</NAME>
    <NEEDS_OPTION>TONEMAPPING_FILMICALU</NEEDS_OPTION>
  </CONSTANT_BUFFER>

  <CONSTANT_BUFFER>
    <NAME>cbPostEffect_ToneMapping_Photographic</NAME>
    <NEEDS_OPTION>TONEMAPPING_PHOTOGRAPHIC</NEEDS_OPTION>
  </CONSTANT_BUFFER>

  <!-- Exposure -->
  
  <CONSTANT_BUFFER>
    <NAME>cbPostEffect_Exposure_Fix</NAME>
    <NEEDS_OPTION>EXPOSURE_FIX</NEEDS_OPTION>
  </CONSTANT_BUFFER>
    
  <!-- Bloom -->

  <CONSTANT_BUFFER>
    <NAME>cbPostEffect_Bloom</NAME>
    <NEEDS_OPTION>BLOOM</NEEDS_OPTION>
  </CONSTANT_BUFFER>
  
  <!-- Vignetting -->

  <CONSTANT_BUFFER>
    <NAME>cbPostEffect_Vignetting_Photographic</NAME>
    <NEEDS_OPTION>VIGNETTING_PHOTOGRAPHIC</NEEDS_OPTION>
  </CONSTANT_BUFFER>

  <CONSTANT_BUFFER>
    <NAME>cbPostEffect_Vignetting_Photographic_Auto</NAME>
    <NEEDS_OPTION>VIGNETTING_PHOTOGRAPHIC</NEEDS_OPTION>
  </CONSTANT_BUFFER>
  
  <!--Gamma Correction -->
  
  <CONSTANT_BUFFER>
    <NAME>cbPostEffect_GammaCorrection</NAME>
    <NEEDS_OPTION>GAMMACORRECTION</NEEDS_OPTION>
  </CONSTANT_BUFFER>

  <SAMPLER>
    <NAME>s_SourceTex</NAME>
    <SAMPLER_DECLARATION>
      <SAMPLER_TYPE>sampler2DMS</SAMPLER_TYPE>
      <SAMPLER_OPTION_GRAMMAR>MSAA</SAMPLER_OPTION_GRAMMAR>
    </SAMPLER_DECLARATION>
    <SAMPLER_DECLARATION>
      <SAMPLER_TYPE>sampler2D</SAMPLER_TYPE>
      <SAMPLER_OPTION_GRAMMAR>!MSAA</SAMPLER_OPTION_GRAMMAR>
    </SAMPLER_DECLARATION>
    <SAMPLER_SECONDARY_TYPE>color</SAMPLER_SECONDARY_TYPE>
  </SAMPLER>
  
  <SAMPLER>
    <NAME>s_ExposureTex</NAME>
    <SAMPLER_DECLARATION>
      <SAMPLER_TYPE>sampler1D</SAMPLER_TYPE>
      <SAMPLER_OPTION_GRAMMAR>EXPOSURE_AUTO</SAMPLER_OPTION_GRAMMAR>
    </SAMPLER_DECLARATION>
    <SAMPLER_SECONDARY_TYPE>value</SAMPLER_SECONDARY_TYPE>
  </SAMPLER>

  <SAMPLER>
    <NAME>s_BloomTex</NAME>
    <SAMPLER_DECLARATION>
      <SAMPLER_TYPE>sampler2D</SAMPLER_TYPE>
      <SAMPLER_OPTION_GRAMMAR>BLOOM</SAMPLER_OPTION_GRAMMAR>
    </SAMPLER_DECLARATION>
  </SAMPLER>

  <SAMPLER_STATE>
    <NAME>smpLinear</NAME>
    <MAG_FILTER>Linear</MAG_FILTER>
    <MIN_FILTER>Linear</MIN_FILTER>
    <MIP_FILTER>None</MIP_FILTER>
    <WRAP_U>ClampToEdge</WRAP_U>
    <WRAP_V>ClampToEdge</WRAP_V>
  </SAMPLER_STATE>
  
  <TECHNIQUE>
    <NAME>PostProcess</NAME>
    <PASS>
      <NAME>Pass0</NAME>
      <SAMPLER_ASSIGNMENT_LIST>
        <SAMPLER_ASSIGNMENT>
          <SAMPLER>s_SourceTex</SAMPLER>
          <STATES>smpLinear</STATES>
        </SAMPLER_ASSIGNMENT>
        <SAMPLER_ASSIGNMENT>
          <SAMPLER>s_ExposureTex</SAMPLER>
          <STATES>smpLinear</STATES>
        </SAMPLER_ASSIGNMENT>
        <SAMPLER_ASSIGNMENT>
          <SAMPLER>s_BloomTex</SAMPLER>
          <STATES>smpLinear</STATES>
        </SAMPLER_ASSIGNMENT>
      </SAMPLER_ASSIGNMENT_LIST>

      <STREAMS>
        <STREAM>
          <STAGES>Vertex_Fragment</STAGES>
          <VARYING>
            <NAME>vTexCoord</NAME>
            <TYPE>float2</TYPE>
            <QUALIFIER>smooth</QUALIFIER>
          </VARYING>
        </STREAM>
      </STREAMS>

      <SHADER_OPTIONS>
        <SHADER_OPTION>
          <NAME>NeedUVs</NAME>
          <OPTION_VALUE>1</OPTION_VALUE>
        </SHADER_OPTION>
        <SHADER_OPTION>
          <NAME>TexCoordAsVec2</NAME>
          <OPTION_VALUE>1</OPTION_VALUE>
        </SHADER_OPTION>
      </SHADER_OPTIONS>
      
      <BLEND_STATE>NoBlend</BLEND_STATE>
      <DEPTH_STENCIL_STATE>DepthNoTestNoWrite</DEPTH_STENCIL_STATE>
      <COMMONS>streams varyings</COMMONS>
      <VERTEX_STAGE>PostEffect_FullScreenQuadVS</VERTEX_STAGE>
      <FRAGMENT_STAGE>PostEffect_DeclarePS PostEffect_Helpers PostEffect_ColorProcessing</FRAGMENT_STAGE>
    </PASS>
  </TECHNIQUE>

</EFFECT>
